//
//  ViewController.m
//  数据存储方式
//
//  Created by whz on 17/2/27.
//  Copyright © 2017年 whz. All rights reserved.
//

#import "ViewController.h"
#import "NSUserDefaultContentSaveViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    // NSUserDefault
    [self userDefaultSave];
}

- (void)userDefaultSave {
    
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.center.x-50, 100, 100, 50)];
    [self.view addSubview:btn];
    [btn setTitle:@"userDefaultSave" forState:UIControlStateNormal];
    btn.titleLabel.textAlignment = NSTextAlignmentCenter;
    btn.titleLabel.font = [UIFont systemFontOfSize:13];
    [btn setTitleColor:[UIColor purpleColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(userDefaultSaveBtn) forControlEvents:UIControlEventTouchUpInside];
}

- (void)userDefaultSaveBtn {
    
    NSUserDefaultContentSaveViewController *userDefaultSava = [[NSUserDefaultContentSaveViewController alloc] init];
    [self presentViewController:userDefaultSava animated:YES completion:nil];
}

@end
